//
//  CYXMLReader.m
//  CaiYun
//
//  Created by 今日信息科技 on 2017/9/25.
//  Copyright © 2017年 今日信息科技. All rights reserved.
//

#import "CYXMLReader.h"
#import <XMLReader.h>
@implementation CYXMLReader
+ (NSDictionary *)readerWithXMLString:(NSString *)string{
    
    if (!string)
        return nil;
    if ([string containsString:@"&"])///特殊符号"&"，替换成"&amp;"
        string = [string stringByReplacingOccurrencesOfString:@"&" withString:@"&amp;"];
    NSError *error;
    NSDictionary *dict = [XMLReader dictionaryForXMLString:string error:&error];
    if (dict[@"dinpay"][@"response"])
        return dict[@"dinpay"][@"response"];
    else
        return nil;
}
@end
